import csv
#newline='' 不产生换行符
def wirte() :
    with open('student.csv','w',encoding='utf8',newline='') as f :
        writer = csv.writer(f)
        listconter = [("name","age","gender"),("yulidong",18,"男")]
        writer.writerows(listconter)

def read() :
    with open('student.csv','r',encoding='utf-8') as f :
        reader = csv.reader(f)
        for row in reader :
            print(row)

if __name__ == '__main__' :
    wirte()
    read()